<template>
    <component :is="comptName" @goto="goto" :args="args"></component>
</template>

<script>

import panelList  from './childPanel/panel-list.vue'

export default {
    name: 'panel',

    components: {
        panelList
    },

    data () {
        return {
            comptName: "panelList",
            args: {}
        }
    },
    methods: {
        goto(name, args) {
            this.comptName = name;
            this.args = args;
        }
    },
    beforeRouteLeave (to, from, next) {
        this.$destroy();
        next();
    }
}
</script>
